var initMenuTab = function() {
		YEvent.delegate("menuListTable", "click", viewMenu, '.view-menu-link');
		YEvent.delegate("menuListTable", "click", deleteMenu, '.delete-menu-link');
};
	
var viewMenu = function(event) {
	
	// 'this' refers to element that was clicked
	var parentRow = getParentRow(this);
	// Make xhr call get entity details
	var id = parentRow.readAttribute("menuId");
	getTabContent("menu/edit?menuId="+id);
	
};

var viewUser = function(event) {
		
		// 'this' refers to element that was clicked
		var parentRow = getParentRow(this);
		// Make xhr call get entity details
		var id = parentRow.readAttribute("menuId");
		getTabContent("menu/edit?id="+id);
		
};

var createNewMenu = function() {
	goToTab("MENU");
	getTabContent("menu/add");
		
};

var returnToMenuList = function() {
	getTabContent("menu");
};

var deleteGallery = function(event){
	
	
	if (confirm("Are you want to delete?")) {
		// 'this' refers to element that was clicked
		var parentRow = getParentRow(this);
		// Make xhr call get entity details
		var id = parentRow.readAttribute("menuId");
		getTabContent("menu/delete?menuId="+id);
	} else {
		return false;
	}
};